/*
*  Date()
* let date =  new  Date()
* */

// new关键词创建对象   当前系统时间
// let date = new Date()
// let date = new Date(1750127700357)
let date = new Date(2025, 5, 17, 10, 10, 10)
console.log(date)

//时间分量获取
let year = date.getFullYear()
console.log(year)
//  0-11
let month = date.getMonth() + 1
console.log(month)
let day = date.getDate()
console.log(day)
let hours = date.getHours()
console.log(hours)
let minutes = date.getMinutes()
console.log(minutes)
let seconds = date.getSeconds()
console.log(seconds)
let str_date = '今天是' + year + '年' + month + '月' + day + '日 ' + hours + ':' + minutes + ':' + seconds
console.log(str_date)
document.write(str_date)


//  创建一个指定的时间  毫秒值 格林威治时间
let millionSeconds = date.getTime()
console.log(millionSeconds)

// 改变时间分量
date.setFullYear(2026)
console.log(date)
